﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;
namespace BUS
{
    public class MonAnBUS
    {
        MonAnDAO mndao = new MonAnDAO();
        public string TenMonAn(int Ma)
        {
            return mndao.TenMonAn(Ma);
        }
        public int ThemMonAn(MonAnDTO mn)
        {
            return mndao.ThemMonAn(mn);
        }
        public int CapNhatMonAn(MonAnDTO mn)
        {
            return mndao.CapNhatMonAn(mn);
        }
        public int XoaMonAn(int ma)
        {
            return mndao.XoaMonAn(ma);
        }
        public int LayMaMonAn()
        {
            return mndao.LayMaMonAn();
        }
        public List<MonAnDTO> LayDanhSachMonAn()
        {
            return mndao.LayDanhSachMonAn();
        }
        //tra cuu mon an theo ten loai mon an
        //lay mon an
        public List<MonAnDTO> laymonan(int MaLoai)
        {
            MonAnDAO ds = new MonAnDAO();
            List<MonAnDTO> kq = ds.Laymonan(MaLoai);
            return kq;

        }
        //lay gia mon an theo ma ban
        public float LayGiaMonAnTheoMaBan(string MaBan, int MaMonAn)
        {
            return mndao.LayGiaMonAnTheoMaBan(MaBan, MaMonAn);
        }
        //tra cuu mon an theo gia 
        //gia nha hang
        public List<MonAnDTO> laymonantheogianhanhang(float giabatdau, float giaketthuc)
        {
            MonAnDAO ds = new MonAnDAO();
            List<MonAnDTO> kq = ds.Laymonantheogianhahang(giabatdau, giaketthuc);
            return kq;
        }
        //gia binh dan
        public List<MonAnDTO> laymonantheogianbinhdan(float giabatdau, float giaketthuc)
        {
            MonAnDAO ds = new MonAnDAO();
            List<MonAnDTO> kq = ds.Laymonantheogiabinhdan(giabatdau, giaketthuc);
            return kq;
        }
        //kiem tra mon an
        public int KiemTraMonAn(int MAMN)
        {
            return mndao.KiemTraMonAn(MAMN);
        }
    }
}
